package com.settlement.system.service.impl;

import com.settlement.system.mapper.TblRpaDtSmsFilterMapper;
import com.settlement.system.common.exception.ServiceException;
import com.settlement.system.service.ITblRpaDtSmsFilterService;
import org.springframework.stereotype.Service;
import com.settlement.system.mapper.BaseMapper;
import org.springframework.transaction.annotation.Transactional;

import jakarta.annotation.Resource;

/**
 * RPA钉钉短信过滤配置表 服务实现类
 * @author xiaochuan
 * @since 2021-12-28
 */
@Service
public class TblRpaDtSmsFilterServiceImpl extends BaseServiceImpl implements ITblRpaDtSmsFilterService {

    @Resource
    private TblRpaDtSmsFilterMapper tblRpaDtSmsFilterMapper;

    @Override
    public BaseMapper init() {
        return tblRpaDtSmsFilterMapper;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public <ModelType> Integer update(ModelType modelType) throws ServiceException {
        super.update(modelType);
        tblRpaDtSmsFilterMapper.deleteTempData();
        tblRpaDtSmsFilterMapper.updateVerifyType();
        tblRpaDtSmsFilterMapper.updateSaveOrNot();
        tblRpaDtSmsFilterMapper.updateGroupInfo();
        return 1;
    }
}

